package com.sandwich.admin.controller.v1;

import com.sandwich.admin.apibean.ContentSummaryRequest;
import com.sandwich.admin.domain.ContentSummaryEntity;
import com.sandwich.admin.service.ContentSummaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @description 房源信息
 * @date 2021-07-28
 */
@RestController("MngContentSummaryControllerV1")
@RequestMapping("/mng/v1")
public class ContentSummaryController {

    @Autowired
    private ContentSummaryService contentSummaryService;


    /**
     * 添加简介
     */
    @PostMapping("/contentSummary")
    public ResponseEntity<?> addContentSummary(HttpServletRequest request,
                                               @RequestBody ContentSummaryRequest contentSummaryRequest) {
        ContentSummaryEntity summaryEntity = contentSummaryService.addOrUpdateContentSummary(contentSummaryRequest);
        return new ResponseEntity<>(HttpStatus.CREATED);
    }
}